package tsing.javase.designpattern.responsibilityChain.responseChain2.config;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import tsing.javase.designpattern.responsibilityChain.responseChain2.response.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author Tsing/吴清平
 * @Date 2022/11/3 14:47
 * @Version 1.0
 */
@Configuration
public class PiepleConfig {
    @Autowired
    private IpCheckProcess ipCheckProcess;

    @Autowired
    private BlackCheckProcess blackCheckProcess;

    @Autowired
    private SmsSendProcess smsSendProcess;

    @Bean
    public PiepleService getPiepleServiceInstance(){

        PiepleService piepleService = new PiepleService();
        ArrayList<BusiProcess> busiList = new ArrayList<>();
        busiList.add(ipCheckProcess);
        busiList.add(blackCheckProcess);
        busiList.add(smsSendProcess);
        piepleService.setTemplateConfig(busiList);
        return piepleService;
    }

}
